<div class="container">
    <div class="panel dux-box">
        <div class="panel-head">{$name}菜单</div>
        <form method="post" class="form-x" action="{url()}">
            <div class="panel-body">
                <div class="form-group">
                    <div class="label">菜单标题</div>
                    <div class="field">
                        <input type="text" class="input" id="name" name="name" size="60" data-validate="required:必填" placeholder="请输入菜单名称" value="{$info.name}">
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">菜单顺序</div>
                    <div class="field">
                        <input type="number" class="input" id="sequence" name="sequence" data-validate="required:必填" value="{default_data($info['sequence'],1)}">

                    </div>
                </div>
                <div class="form-group">
                    <div class="label">菜单图标</div>
                    <div class="field">
                        <input type="text" class="input" id="icon" name="icon" value="{$info['icon']}">
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">菜单位置</div>
                    <div class="field">
                        <select class="input" name="position" id="position">
                            <!--if{$info['position'] == 0}-->
                            <option value="0" selected>
                                <!--{else}-->
                                <option value="0">
                                    <!--{/if}-->
                                    全部</option>
                                <!--if{$info['position'] == 2}-->
                                <option value="1" selected>
                                    <!--{else}-->
                                    <option value="1">
                                        <!--{/if}-->
                                        导航</option>
                                    <!--if{$info['position'] == 3}-->
                                    <option value="2" selected>
                                        <!--{else}-->
                                        <option value="2">
                                            <!--{/if}-->
                                            底部</option>
                        </select>

                    </div>
                </div>
                <div class="form-group">
                    <div class="label">首页菜单</div>
                    <div class="field">
                        <select class="input" name="index" id="index">
                            <!--if{$info['index'] == 0}-->
                            <option value="0" selected>
                                <!--{else}-->
                                <option value="0">
                                    <!--{/if}-->
                                    取消首页</option>
                                <!--if{$info['index'] == 1}-->
                                <option value="1" selected>
                                    <!--{else}-->
                                    <option value="1">
                                        <!--{/if}-->
                                        设为首页</option>
                        </select>

                    </div>
                </div>
                <div class="form-group">
                    <div class="label">菜单内容</div>
                    <div class="field">
                        <div class="tab">
                            <div class="tab-head">
                                <ul class="tab-nav" id="tab">
                                    <li <!--if{!$info[ 'type']}-->class="active"
                                        <!--{/if}-->><a href="#tab-diy" data="0">自定义URL</a>
                                    </li>
                                    <li <!--if{$info[ 'type']}-->class="active"
                                        <!--{/if}-->><a href="#tab-model" data="1">系统URL</a>
                                    </li>
                                </ul>
                            </div>
                            <div class="tab-body">
                                <div class="tab-panel  <!--if{!$info['type']}--> active <!--{/if}-->" id="tab-diy">
                                    <input type="text" class="input" id="diy" name="diy" size="60" placeholder="请输入URL" <!--if{!$info['type']}-->value="{$info.url}"<!--{/if}-->>
                                </div>
                                <div class="tab-panel <!--if{$info['type']}-->active <!--{/if}-->" id="tab-model">
                                    <select class="input" name="model">
                                       <optgroup label="系统菜单">
                                        <!--loop{$modelList as $key => $vo}-->
                                        <!--if{$info['url'] == $key}-->
                                        <option value="{$key}" selected>
                                        <!--{else}-->
                                        <option value="{$key}">
                                        <!--{/if}-->
                                        {$vo.name}</option>
                                        <!--{/loop}-->
                                        </optgroup>
                                       <optgroup label="页面链接">
                                        <!--loop{$pageList as $key => $vo}-->
                                        <!--if{$info['url'] == 'pages_'.$vo['page_id']}-->
                                        <option value="pages_{$vo['page_id']}" selected>
                                        <!--{else}-->
                                        <option value="pages_{$vo['page_id']}">
                                        <!--{/if}-->
                                        {$vo.title}</option>
                                        <!--{/loop}-->
                                        </optgroup>
                                    </select>
                                    <div class="input-note">可以选择系统中的模块</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel-foot">
                <div class="form-button">
                    <div id="tips"></div>
                    <input type="hidden" id="type" name="type" type="hidden" value="{$info.type}">
                    <input type="hidden" name="menu_id" type="hidden" value="{$info.menu_id}">
                    <button class="button bg-main" type="submit">保存</button>
                    <button class="button bg" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
    <br>
</div>
<script>
    Do.ready('base', function () {
        //选择
        $('#tab a').click(function () {
            $('#type').val($(this).attr('data'));
        });
    });
</script>